﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="RoomAE.aspx.cs" Inherits="Admin_Modules_Room_RoomAE" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <%-------------------------%>
    <div class="header" style="width: 1080px; text-align: left">
        THÊM PHÒNG MỚI
        <div class="content-IE">            
            <telerik:RadScriptManager ID="RadScriptManager1" ScriptMode="Release" runat="server">
            </telerik:RadScriptManager>
            <table class="adminContent">
                <tr>
                    <td class="adminTitle">
                        &nbsp;
                    </td>
                    <td class="adminTitle" colspan="2">
                        <h2>
                            <asp:Literal ID="lblChannel" runat="server"></asp:Literal></h2>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table>
                            <tr id="trTitle" runat="server">
                                <td class="adminTitle">
                                    <asp:Label ID="lblName" runat="server">Tên Phòng</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtName" runat="server" CssClass="width_a"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="rfvName" ControlToValidate="txtName" runat="server"
                                        ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr id="tr7" runat="server">
                                <td class="adminTitle">
                                    <asp:Label ID="lblRoomType" runat="server">Loại Phòng</asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlRoomType" runat="server" CssClass="width_a">
                                    </asp:DropDownList>

                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="ddlRoomType"
                                        runat="server" ErrorMessage="*" ForeColor="Red" InitialValue="-1"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr id="trHead" runat="server">
                                <td class="adminTitle">
                                    <asp:Label ID="lblFacilities" runat="server">Vật dụng</asp:Label>
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="txtFacilities" runat="server" TextMode="MultiLine" Height="100" CssClass="width_a"></asp:TextBox>
                                </td>
                            </tr>
                            <tr id="trSource" runat="server">
                                <td class="adminTitle">
                                    <asp:Label ID="lblLocation" runat="server">Vị trí</asp:Label>
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="txtLocation" runat="server" CssClass="width_a"></asp:TextBox>
                                </td>
                            </tr>                           
                            <tr id="trImage" runat="server">
                                <td class="adminTitle">
                                </td>
                                <td colspan="2">
                                    <div style="float: left; width: 80px; height: 80px; border: solid thin orange;">
                                        <asp:Image ID="imgThumb" runat="server" EnableViewState="true" AlternateText="Ảnh đại diện"
                                            ToolTip="Ảnh đại diện tour" Width="80px" Height="80px" />
                                        <asp:HiddenField ID="hdfimgImageTour" runat="server" />
                                    </div>
                                    <div style="float: left; width: 300px;">
                                        &nbsp;
                                        <telerik:DialogOpener runat="server" ID="DialogOpener1"></telerik:DialogOpener>
                                        <input type="button" id="btnSelectThumb" value="Chọn" style="width: 40px;" onclick="selectThumb()" />
                                        <input type="button" id="btnClearThumb" value="Xóa" style="width: 40px;" onclick="clearThumb()" />
                                    </div>
                                </td>
                            </tr>
                            <%if (RoomId != null && RoomId > 0)
                              { %>
                            <tr>
                                <td class="adminTitle">
                                    Người tạo:
                                </td>
                                <td colspan="2">
                                    <asp:Literal ID="LiteralCreateBy" runat="server"></asp:Literal>
                                </td>
                            </tr>
                            <tr>
                                <td class="adminTitle">
                                    Ngày tạo:
                                </td>
                                <td colspan="2">
                                    <%--<asp:Literal ID="LiteralCreatedDate" runat="server"></asp:Literal>--%>
                                    <asp:TextBox ID="txtCreateDate" runat="server" CssClass="CreateDate"></asp:TextBox>
                                    <asp:Label ID="lblCreateTime" runat="server"></asp:Label>
                                </td>
                            </tr>
                           
                            <%} %>
                        </table>
                        <script type="text/javascript">

                            function selectThumb() {
                                var radEditorContent = $find("<%= DialogOpener1.ClientID %>");
                                radEditorContent.openUrl("/Admin/Modules/FileManager/InsertFTPImage.aspx", {}, 800, 600, selectThumbComplete, null, "custom link manager", true);
                            }

                            function clearThumb() {
                                $('#<%= imgThumb.ClientID %>').attr("scr", "");
                                $('#<%= hdfimgImageTour.ClientID %>').val("");
                            }
                            var selectThumbComplete = function (sender, args) {
                                if (!args.IsCancel) {
                                    if (args.Url.length > 0) {
                                        var img = document.getElementById("<%= imgThumb.ClientID %>");
                                        img.src = args.Url;
                                        $('#<%= hdfimgImageTour.ClientID %>').val(args.Url);
                                        alert($('#<%= hdfimgImageTour.ClientID %>').val());

                                    }
                                }
                            }

                        </script>
                    </td>
                </tr>
            </table>
            <div class="section-header">
                <div class="options">
                    <asp:Button ID="btnSave" runat="server" CssClass="adminButtonBlue" Text="Cập nhật"
                        ToolTip="Save" OnClick="btnSave_Click" />
                </div>
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
</asp:Content>

